﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Blog.Models.UserServices
{
    public class UserRoleRepository:IUserRole
    {
        private DataDataContext db = new DataDataContext();
        public IQueryable<UserRole> FindAlldata()
        {
            return db.UserRoles;
        }

        public UserRole GetByIdMax()
        {
            throw new System.NotImplementedException();
        }

      /*  public UserRole Getdata(int id)
        {
            return (from c in db.UserRoles
                    where c.Id == id
                    select c).FirstOrDefault();
        }
        */
        public void Add(UserRole data)
        {
            db.UserRoles.InsertOnSubmit(data);
        }

        public void Delete(UserRole data)
        {
            db.UserRoles.DeleteOnSubmit(data);
        }

        public void Save()
        {
            db.SubmitChanges();
        }
    }
}
